package cn.edu.Day11;

import java.io.*;
import java.util.Scanner;

public class WriterTest {
    public static void main(String[] args) throws Exception{
        File file=new File("src/resources/in.txt");
        RandomAccessFile raf=new RandomAccessFile(file,"r");
        System.out.println(file.length());
        raf.seek(13);
        String str=raf.readLine();
        System.out.println(str);


//        InputStream is=new FileInputStream(file);
//        InputStreamReader isr=new InputStreamReader(is);
//        char[] cs=new char[1024];
//        isr.read(cs,0,(int)file.length());
//        String str=String.valueOf(cs);
//        System.out.println(str);


//        OutputStream ops=new FileOutputStream("src/resources/in.txt");
//        Writer wri=new OutputStreamWriter(ops);
//        Scanner scanner=new Scanner(System.in);
//        System.out.println("请输入您想要录入文件的内容：");
//        String str=scanner.next();
//        wri.write(str);
//        wri.flush();//讲缓存的内容刷新到文件中
//        wri.close();
//        System.out.println("录入文件完成！");
    }
}
